<template>
  <div>
    <div class="box" :class="{ 'box-bg': visible }"></div>
    <mybutton @click="visible = !visible">点击变化颜色和大小</mybutton>
  </div>
</template>

<script>
import mybutton from "../lesson8/mybutton.vue";
export default {
  components: { mybutton },
  data() {
    return {
      visible: false,
    };
  },
};
</script>

<style scoped>
.box {
  width: 200px;
  height: 200px;
  margin: 20px;
  background: red;
  transition: all 1s;
}
.box-bg {
  background: green;
  width: 400px;
  height: 300px;
}
</style>